package cn.xinzhi.test;

import cn.xinzhi.dao.IDeptDao;
import cn.xinzhi.entity.Dept;
import cn.xinzhi.entity.UserInfo;
import cn.xinzhi.utils.MyBatisUtil;
import org.apache.ibatis.session.SqlSession;

import java.util.Date;
import java.util.List;

public class Mybatis_Main_1totom {
    public static void main(String[] args) {
        SqlSession ss = MyBatisUtil.getSqlSession();
        IDeptDao idd = ss.getMapper(IDeptDao.class);
//        List<Dept> list = idd.getAll();
//        for (Dept d:list) {
//            System.out.println(d.getDeptid()+d.getDeptname());
//        }
        Dept dept = idd.getUserByDept(2);
        System.out.println(dept.getDeptname());
        List<UserInfo> uis = dept.getUis();
        for (UserInfo ui:uis) {
            System.out.println(ui.getUsername());
        }


    }
}
